package
{
	import com.sqstudio.llk.command.PathLogicCommand;
	import com.sqstudio.llk.command.StartUpCommand;
	import com.sqstudio.llk.command.event.GameEvent;
	import com.sqstudio.llk.model.GameModel;
	import com.sqstudio.llk.view.ItemMediator;
	import com.sqstudio.llk.view.ItemView;
	
	import flash.display.DisplayObjectContainer;
	
	import org.robotlegs.base.ContextEvent;
	import org.robotlegs.mvcs.Context;
	
	public class GameContext extends Context
	{
		public function GameContext(contextView:DisplayObjectContainer=null, autoStartup:Boolean=true)
		{
			super(contextView, autoStartup);
		}
		
		override public function startup():void
		{
			commandMap.mapEvent(ContextEvent.STARTUP,StartUpCommand,ContextEvent,true);
			commandMap.mapEvent(GameEvent.RESTART_SELECT,PathLogicCommand,GameEvent);
			mediatorMap.mapView(ItemView,ItemMediator);
			injector.mapSingleton(GameModel);
			dispatchEvent(new ContextEvent(ContextEvent.STARTUP));
		}
	}
}